<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<?php
session_start();
$errorMessage = '';

if (isset($_POST['txtUserId']) && isset($_POST['txtPassword'])) {
	$usr = $_POST['txtUserId'];
	$pwd = $_POST['txtPassword'];
	include("connectdb.php");
	$strSQL = "select * from taikhoan where tendangnhap='$usr' and matkhau='$pwd'";
	$rs = mysql_query($strSQL);
	$count = mysql_num_rows($rs);
	if ($count != 0) {
		$_SESSION['db_is_logged_in'] = true;
		setcookie("UserCookie", $usr, time()+3600);
		header('Location: admin.php');
		exit;
	} else {
		header('Location: loginfailed.php');
	}
	mysql_close();
}
?>
<html>
<head>
<title>Baby Shop</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="styles/style.css" />
<link rel="stylesheet" type="text/css" href="styles/dangnhap.css" />
<script type="text/javascript" src="script/index.js" ></script>
</head>

<body>
	<div>
		<a href="#"><img src="images/logo.jpg" width="237" height="123" class="float" alt="setalpm" /></a>
		<!--<div class="inner_copy"><a href="http://www.greatdirectories.org/">web directories</a><a href="http://www.bestfreetemplates.info/">free CSS templates</a></div>-->
      	<div class="topnav">
			<form name="frmSearch" action="timkiem.php">
			<table border="0">
				<tr>
					<td><b>Tìm Kiếm: </b>&nbsp;</td>
					<td>
						<select name="cbbCategory">
							<option value="">--Tìm Theo--</option>
							<option value="Product">Tên Sản Phẩm</option>
							<option value="Shop">Tên Gian Hàng</option>
						</select>&nbsp;
					</td>
					<td><input type="text" name="txtKeyword"/>&nbsp;</td>
					<td><a href="javascript: timKiem()"><img src="images/search.gif" width="25" height="20" /></a></td>
				</tr>
			</table>
			</form>
		</div>
		<ul id="menu">
			<li><a href="index.html"><img src="images/but1.gif" alt="" width="110" height="32" /></a></li>
			<li><a href="dangnhap.php"><img src="images/but2.gif" alt="" width="110" height="32" /></a></li>
			<li><a href="#"><img src="images/but3.gif" alt="" width="110" height="32" /></a></li>
			<li><a href="#"><img src="images/but4.gif" alt="" width="110" height="32" /></a></li>
			<li><a href="#"><img src="images/but5.gif" alt="" width="110" height="32" /></a></li>
			<li><a href="#"><img src="images/but6.gif" alt="" width="110" height="32" /></a></li>
		</ul>
	</div>
	<div id="content">
		<div id="sidebar">
			<div id="navigation">
				<ul>
					<li><a href="index.html">trang chủ</a></li>
					<li><a href="#">sản phẩm mới</a></li>
					<li><a href="#">tất cả sản phẩm</a></li>
					<li><a href="#">đánh giá</a></li>
					<li><a href="#">F.A.Q.</a></li>
					<li><a href="#">liên hệ</a></li>
				</ul>
				<div id="cart">
					<strong>Giỏ hàng:</strong> <br /> 0 items
				</div>
			</div>
			<div>
				<img src="images/title1.gif" alt="" width="233" height="41" /><br />
				<ul class="categories">
					<li><a href="#">Categories 1</a></li>
					<li><a href="#">Categories 2</a></li>
					<li><a href="#">Categories 3</a></li>
					<li><a href="#">Categories 4</a></li>
					<li><a href="#">Categories 5</a></li>
                    <li><a href="#">Categories 6</a></li>
					<li><a href="#">Categories 7</a></li>
					<li><a href="#">Categories 8</a></li>
				</ul>
				<img src="images/title2.gif" alt="" width="233" height="41" /><br />
				<!--<div class="inner_copy"><a href="http://www.bestfreetemplates.org/">free templates</a><a href="http://www.bannermoz.com/">banner templates</a></div>-->
				<div class="review">
					<a href="#"><img src="hinhsp/item1.jpg" alt="" width="181" height="161" /></a><br />
					<a href="#">Product 07</a><br />
					<p>Thiên tầm ngoa, giày này thật là vãi lắm, mang vô + tốc độ chạy 50%, sinh lực 200 điểm, nội lực 200 điểm ĐỘ NGUY HIỂM 100000, liên hệ ngay nhé máy bạn trẻ , đừng bỏ lỡ cơ hội hiếm có</p>
					<img src="images/stars.jpg" alt="" width="118" height="20" class="stars" />
				</div>
			</div>
		</div>
		<div id="main">
			<img src="images/photo.jpg" alt="" width="682" height="334" border="0" usemap="#Map" /><br /><br /><br />
			<div class="spacer"></div><br />
			<div id="stylized" class="myform">
				<form id="form" name="form" method="post" action="index.html">
				<h1>ĐĂNG NHẬP</h1>
				<p>Xin điền vào các thông tin bên dưới</p>
				
				<label>Username
				<span class="small">Điền vào tên đăng nhập</span>
				</label>
				<input type="text" name="name" id="name" />
				
				<label>Password
				<span class="small">Điền vào mật khẩu</span>
				</label>
				<input type="text" name="password" id="password" />
				
				<button type="submit">Đăng Nhập</button>
				<div class="spacer"></div>
				</form>
			</div>
		</div>
	</div>
	<div id="footer">
		<img src="images/cards.jpg" alt="" width="919" height="76" />
		<ul>
			<li><a href="#">Trang Chủ</a> |</li>
			<li><a href="#">Sản Phẩm Mới</a> |</li>
			<li><a href="#">Tất Cả Sản Phẩm</a> |</li>
			<li><a href="#">Đánh Giá</a> |</li>
			<li><a href="#">F.A.Q.</a> |</li>
			<li><a href="#">Liên Hệ</a></li>
		</ul>
		<p>Copyright ©. All rights reserved. Design by <a href="#" title="Free CSS Templates" target="_blank" class="bft">Lĩn Quang Tiếu</a></p>
		<!--<div class="inner_copy"><a href="http://www.beautifullife.info/">beautiful</a><a href="http://www.grungemagazine.com/">grunge</a></div>-->
	</div>
<map name="Map">
	<area shape="rect" coords="16,306,159,326" href="#">
</map>
</body>
</html>
